import { Base } from '/@/base';
import { Data } from '/@/data';
import { Datetime } from '/@/datetime';
import { Global } from '/@/global';
import { Validate } from '/@/validate';
import { MixClass } from './extends';

// 定义接口类型
interface UtilInterface extends Base, Data, Datetime, Global, Validate {}

// 继承多类
class Utils extends MixClass(Base, Data, Datetime, Global, Validate) {
	constructor() {
		super();
	}

	/**
	 * @description 合并类
	 * @param  {...any} args
	 */
	extendClass(...args: EmptyArrayType) {
		MixClass(...args);
	}
}

export const vhmBase: Base = new Base();
export const vhmData: Data = new Data();
export const vhmDatetime: Datetime = new Datetime();
export const vhmGlobal: Global = new Global();
export const vhmValidate: Validate = new Validate();

export const vhmUtil: EmptyObjectType = new Utils();
window.__VHMU__ = vhmUtil;

export default { base: vhmBase, data: vhmData, datetime: vhmDatetime, global: vhmGlobal, validate: vhmValidate };
